<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/include/taglib.jsp"%>
<html>
<head>
<meta charset="UTF-8">
<title>我的账户-账户验证|验证手机</title>
<jsp:include page="/include/wchat/head.jsp"></jsp:include>
<link type="text/css" rel="stylesheet" href="/v2/wchat/resrc/css/account.css">
<script type="text/javascript">

/**
 * 获取手机验证码
 */
function getMobileCode() {
	//手机号
	var $mobile = $('#mobile');
	//信息提示
	var $errorMsg = $('#errorMsg');
	
	//检验手机号
	if ($mobile.val() == null || $mobile.val() == '') {
    	$errorMsg.html('请输入手机号').show();
    	return false;
	}
	var regMobile = /^(13[0-9]|15[0-9]|18[0-9])\d{8}$/;
	if(!regMobile.test($mobile.val())){
		$errorMsg.html('手机号格式不正确，请检查').show();
	    return false;
	}
	var param = {};
    param["paramMap.mobile"] = $mobile.val();
	//异步请求
	$.ajax({
		type: 'POST',
		url: environment.basePath + "/getMobileCode4Register.do",
		data: param,
		success: function(data) {
			//错误等信息提示
			if(data.code < 0){
				$errorMsg.html(data.msg).show();
				return false;
			}
			
			//跳转验证页面
			window.location.href = environment.basePath + "/preVerifyMobile4RegisterByRedEnvelopes.do?mobile=" + data.dict.mobile + "&mai=" + data.dict.mobileAuthenId;
		}
	});//End...$.ajax
}
</script>
</head>
<body>
<div id="header"> 
	<a href="javascript:history.go(-1);" class="backto">返回</a>
	<div class="title-sub">验证账户信息</div>
</div>
<div id="wrap">
	<div class="phoneBind">
		<%-- <div class="itip regist-itip"><b class="novice-50"></b></div> --%>
		<p style="padding:0 15px 15px; color:#9FABB2; text-align:center">只差一步就可使用红包</p>
		<div class="link-touch">
			<ul class="items">
				<li>
					<label class="txt">手机号</label>
					<input type="text" id="mobile" class="input" value="${mobileLast}" maxlength="11" readonly="readonly"/>
				</li>
			</ul>
			<div id="errorMsg" class="vtip errs none">此手机号已与其他账号绑定，请更换手机号</div>
		</div>
		<div class="operate-button operate-acc"> <a href="javascript:;" class="btn" onclick="return getMobileCode();">获取手机验证码</a></div>
	</div>
</div>



<jsp:include page="/include/wchat/footer.jsp"></jsp:include>

</body>
</html>